<?php

namespace App\Http\Controllers\API;

use App\Http\Requests\API\CreateNavigateAPIRequest;
use App\Http\Requests\API\UpdateNavigateAPIRequest;
use App\Models\Config;
use App\Models\Navigate;
use App\Repositories\NavigateRepository;
use App\ZL\Controllers\ApiBaseController;
use Illuminate\Http\Request;
use App\Http\Controllers\AppBaseController;
use InfyOm\Generator\Criteria\LimitOffsetCriteria;
use Prettus\Repository\Criteria\RequestCriteria;
use Response;

/**
 * Class NavigateController
 * @package App\Http\Controllers\API
 */

class NavigateAPIController extends ApiBaseController
{
    /** @var  NavigateRepository */
    private $navigateRepository;
    protected $model_name = 'App\Models\Navigate';
    protected $model_load_array = [
    ];

    public function __construct(NavigateRepository $navigateRepo)
    {
        $this->navigateRepository = $navigateRepo;
    }

    public function _after_get($array)
    {
        $data['navigates'] = $array->toArray();
        $data['navigates_background_image'] = Config::where('type','navigates_background_image')->value('value');
        return $data;
    }
}
